package com.jiayi.microservice.controller;

import com.jiayi.microservice.pojo.Item;
import com.jiayi.microservice.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Item Controller
 * @author: CONCENTRATE
 * @time: 2018/11/3.
 */
@RestController
public class ItemController {

    @Autowired
    private ItemService itemService;

    /**
     * METHOD queryItemById
     * @param id
     * @return
     */
//    @RequestMapping(value = "/item/{id}", method = GET)
    @GetMapping(value = "/item/{id}")
    public Item queryItemById(@PathVariable(name = "id") Long id){
        return itemService.queryItemById(id);
    }

}
